<template>
  <div>
    <van-nav-bar
        title="密码登录"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
        />
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="用户名"
        label="用户名"
        placeholder="用户名"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="验证码"
        label="验证码"
        placeholder="验证码"
        :rules="[{ required: true, message: '请填写验证码' }]"
      />
      <div>
        <van-button round block type="info" native-type="submit">提交</van-button>  
      </div>
    </van-form>

    <text rows="" cols="">
        温馨提示：未注册过的账号，登录时将自动注册
    </text>
    <text>
        注册过的用户可凭账号密码登录
    </text>
    <van-button>qqqqqq</van-button>
  </div>
</template>

<script>
import { Button, Form, Field, NavBar, Toast, } from 'vant';

export default {
    name:'Login',
    data(){
        return{
            username:'',
            password:'',
        };
    },
    components:{
        [Button.name]: Button,
        [Form.name]: Form,
        [Field.name]: Field,
        [NavBar.name]: NavBar,
    },
    methods: {
        onClickLeft(){
            Toast('返回');
        },
        onSubmit(values){
            console.log('sumbit', values);
        }
    },
};
</script>

<style>
.van-nav-bar__content{
    background: #3190e8;
}
.van-nav-bar__title, .van-nav-bar__left, .van-nav-bar .van-icon, .van-nav-bar__text{
    color: white;
}

.van-button{
    background: #3190e8;
    height: 100px;
    width: 200px;
}
</style>
